<template>
  <div class="cloud" v-if="hotTagData.length > 0">
    <h2 style="margin-left: 5px" class="hometitle">标签云</h2>
    <ul>
      <a v-for="item in hotTagData" :key="item.uid" href="javascript:void(0);" @click="goToList(item.uid)">{{item.content}}</a>
    </ul>
  </div>
</template>

<script>
//import { getHotTag } from '../../api/index'
export default {
  name: 'TagCloud',
  data () {
    return {
      hotTagData: [{
				uid: 1,
				content: 'Java'
      },{
				uid: 2,
				content: '数据结构'
			},{
				uid: 3,
				content: 'SpringCloud'
			},{
				uid: 4,
				content: 'SpringBoot'
			},{
				uid: 5,
				content: '设计模式'
			},{
				uid: 6,
				content: '阿里云'
			},{
				uid: 7,
				content: '贪心算法'
			},{
				uid: 8,
				content: 'Java虚拟机'
			},{
				uid: 9,
				content: '腾讯云'
			},{
				uid: 10,
				content: '排序算法'
			},{
				uid: 11,
				content: '动态规划算法'
			},{
				uid: 12,
				content: 'Spring'
			},{
				uid: 13,
				content: 'Oauth2.0'
			},{
				uid: 14,
				content: 'ElementUI'
			},{
				uid: 15,
				content: '校园生活'
			},{
				uid: 16,
				content: 'Vue.js'
			},{
				uid: 17,
				content: 'Docker'
			},{
				uid: 18,
				content: '深度优先搜索算法'
			}] // 标签列表
    }
  },
  created () {
    // getHotTag().then(response => {
    //   if (response.code === this.$ECode.SUCCESS) {
    //     this.hotTagData = response.data.records
    //   }
    // })
  },
  methods: {
    // 跳转到搜索详情页
    goToList (uid) {
      // let routeData = this.$router.resolve({ path: '/list', query: { tagUid: uid } })
      // window.open(routeData.href, '_blank')
			this.$message({
				message: '用户老爷,标签服务正在努力上线中......',
				type: 'primary',
				center: true
			})
    }
  }
}
</script>

<style scoped src="../../assets/css/index.css">
</style>
